package com.tea.source.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tea.source.dao.UserDao;
import com.tea.source.model.User;

@Component("userService")
public class UserService {
	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}
	@Resource
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	public boolean checkUserExit(User user) {
		
		return userDao.isUserExit(user);
	}
	public User getUser(User user) {
		return this.userDao.getUser(user);
	}
	
	public List<User> load(){
		
		return this.userDao.load();
	}
	
	public User loadById(int id){
		
		return this.userDao.loadById(id);
	}
	
	public void add(User user){
		
		this.userDao.save(user);
	}
	
	public void update(User user){
		this.userDao.update(user);
	}
	
	public void deleteById(int id){
		this.userDao.deleteById(id);
	}
	
	
	

}
